	var AttachmentView=function(selector){
		this.selector=selector;
	}
	AttachmentView.prototype=new Control();
	AttachmentView.prototype.init=function(){
		this.value=$(this.selector).val();
		this.create();
	}
	AttachmentView.prototype.create=function(){
		this.container=$("<div class=\"ht-attachmentView\"></div>").get(0);
		
		var valueArray=this.value.split(",");
		//console.log(valueArray);
		for(var i=0;i<valueArray.length;i++){
			var attachmentItem=new AttachmentItem(valueArray[i]);
			attachmentItem.init();
			
			$(this.container).append(attachmentItem.getElement());
		}
		$(this.selector).after(this.container);
	}
	AttachmentView.prototype.getElement=function(){
		return this.element;
	}
	
	var AttachmentItem=function(value){
		this.value=value;
	}
	AttachmentItem.prototype.element=null;
	AttachmentItem.prototype.init=function(){
		this.create();
	}
	AttachmentItem.prototype.create=function(){
		var valueArray=this.value.split("|");
		
		if(valueArray.length>1){
			var serverFileName=valueArray[0]
			var sourceFileName=valueArray[1]
			serverFileName=encodeURI(serverFileName)
			sourceFileName=encodeURI(sourceFileName)
			var href="/content/uploadFiles/"+serverFileName;
			href="/base/file/download.do?fileType=upload&fileName="+serverFileName+"&sourceFileName="+sourceFileName;
			this.element=$("<div><a href=\""+href+"\" target=\"_blank\"><span class=\"icon xls\"></span><span class=\"fileName\">"+sourceFileName+"</span></a></div>").get(0)
		}
	}
	AttachmentItem.prototype.getElement=function(){
		return this.element;
	}
	HTMLTurbo.control.AttachmentView=AttachmentView;